import http from '@/utils/http'

const BASE_URL = '/cakerun/store-sales-rating-statistics'

export interface StoreSalesRatingStatisticsResp {
  shopName: number
  cakeSize: string
  cakeSizeCount: string
  cakeSizeAmount: string
  cakeTotalAmount: string
  bakeryCount: number
  bakeryAmount: number
  goodReviewCount: number
  rating: number
}

export interface StoreSalesRatingStatisticsReq {
  statisticsDate: string
  accountIds?: string[]
}

export function fetchStoreSalesRatingStatistics(query: StoreSalesRatingStatisticsReq) {
  return http.get<StoreSalesRatingStatisticsResp[]>(`${BASE_URL}`, query)
}

export function exportStoreSalesRatingStatistics(query: StoreSalesRatingStatisticsReq) {
  return http.download(`${BASE_URL}/export`, query)
}
